package com.xiangmo.travel.Enums;

public enum CodeAndMsg {

    //User
    USER_NAME_ERROR(501, "用户名已存在"),
    USER_REGISTER_ERROR(502, "用户注册失败"),
    LOGIN_NAME_ERROR(503, "用户名错误"),
    LOGIN_PASSWORD_ERROR(504, "密码错误"),
    //Attractions
    ATTRACTIONS_PUBLISHED_ERROR(505, "发布失败"),
    ATTRACTIONS_CONTENT_ERROR(506, "文章不存在"),
    //comments
    COMMENT_ERROR(507, "评论发布失败"),
    DELETE_ERROR(508, "删除失败"),
    COLLECT_ERROR(509, "该收藏已存在"),
    TEAM_ERROR(510, "队伍已存在"),
    TEAM_USER_ERROR(511, "用户已存在队伍中"),
    TEAM_REQUEST_ERROR(512, "入队请求已存在"),
    LIKE_ERROR(513, "点赞已存在"),
    DELETE_SUCCESS(201, "删除成功"),
    UPDATE_SUCCESS(202, "更新成功"),
    LOGIN_OUT_SUCCESS(203, "退出登录成功"),
    FILE_NULL_ERROR(514, "上传文件不能为空"),
    FILE_ERROR(515, "上传文件失败"),
    FILE_NO_ERROR(516, "未知文件"),
    CHILD_ERROR(517, "没有子评论"),

    TOKEN_ERROR(-1, "Token错误"),
    SUCCESS(200, "操作成功"),
    ERROR_ROOT(1000, "权限不足"),
    ERROR(500, "操作失败");


    private int Code;
    private String Message;

    CodeAndMsg(int Code, String Message) {
        this.Code = Code;
        this.Message = Message;
    }
    public String getMessage() {
        return Message;
    }
    public int getCode() {
        return Code;
    }
    public String getCodeStr() {
        return String.valueOf(Code);
    }
}
